<?php 

if(!isset($_SESSION)) session_start();
if (!isset($_SESSION['f_user_id'])) {
	echo 'Access denied!';
} else {

	$this->page_title = 'Classrooms';

	require_once $this->base_path.'/include/gam-models.php';

	$form = $this->form('classroom_grid')
		->grid('classrooms',null,array(
				'id' => t('Id'),
				'name' => t('Name','classroom'),
				'description' => t('Description','classroom'),
			),
			f()->db()->select('classroom','*',array(),'Classroom')->exec()
			,array(
				'toolbar' => array(
					'add' => array('label' => t('New'),
						'action' => '/classroom-add', 'method' => 'link'),
				),
				'buttons' => array(
					'modify' => array('label' => t('Edit'), 
						'action' => '/classroom/{#}', 'method' => 'link'),
					'delete' => array('label' => t('Delete'), 'action' => '/classroom-delete/{#}',
						'confirm' => t('Are you sure you want to remove the user permanently?')),
				),
			))
		->render();

}